package com.scau.data.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.scau.data.entity.FactoryDO;
import com.scau.data.entity.OrderLineDO;
import org.apache.ibatis.annotations.Select;

public interface OrderLineMapper extends BaseMapper<OrderLineDO> {
    @Select("select factory.* from \n" +
            "(select * from order_line \n" +
            "group by (bar_code) ) as t1 \n" +
            "JOIN `order` USING(order_number) \n" +
            "JOIN factory ON `order`.factory_id = factory.id \n" +
            "where bar_code = #{barCode}")
    public FactoryDO getFactoryByBarCode(String barCode);
}
